package com.vim.common.utils;

import com.vim.common.exception.BusinessException;
import com.vim.common.model.exception.BusinessExceptionEnums;

/**
 * 参数校验工具
 */
public final class ValidateUtils {

    /**
     * 不为空
     */
    public static void checkNotBlank(String param){
        if(param == null || "".equals(param)){
            throw new BusinessException(BusinessExceptionEnums.ERROR_PARAM_NULL);
        }
    }

    /**
     * 不为0
     */
    public static void checkNotZero(Integer param){
        if(param == null || param == 0){
            throw new BusinessException(BusinessExceptionEnums.ERROR_PARAM_NULL);
        }
    }
}
